import http from "@/http";
import type { userTable } from "./userTable";

//登录
export const loginUserApi = (parm:any)=>{
    return http.post("/api/user/login",parm)
}

//注册
export const registerUserApi  = (parm:userTable)=>{
    return http.post("/api/user/register",parm)
}

//更新用户信息
export const updateUserApi = (user: userTable) => {
    return http.put("/api/user/updateUser", user);
}


//ai方法
//获取用户列表（分页）
export const getUserListPageApi = (page: number, pageSize: number, searchQuery?: string) => {
    return http.get("/api/user/getUserList", { page, pageSize, searchQuery });
}

//修改用户状态
export const updateUserStatusApi = (user:userTable) => {
    return http.put("/api/user/updateStatus", user);
}

//删除用户
export const deleteUserApi = (userId: string) => {
    return http.delete(`/api/user/deleteUser/${userId}`);
}